How to unpack and repack a Debian package

last modified

2025–5–16

To unpack file tree into :

dpkg -X /path/to/package.deb directory

To unpack control information into /DEBIAN:

cd directory
dpkg-deb -e /path/to/package.deb

To repack into a suitably named debfile:

cd ..
dpkg-deb -b directory .